/*
 * User: rant
 * Date: Jul 18, 2007
 *
 *
 */
package laMalinche.rete.rule;

import org.jetbrains.annotations.NotNull;

/**
 *
 */
public abstract class BasicProductionRule implements ProductionRule {
	private Action action;
    private String trigeredBy;
    private BusinessRuleType businessRuleType = BusinessRuleType.substituteUnknownValue;
    private int priority;

    public String getTrigeredBy() {
        return trigeredBy;
    }

    public void setTrigeredBy(String trigeredBy) {
        this.trigeredBy = trigeredBy;
    }

    public BusinessRuleType getProductionRuleType() {
		return businessRuleType;
	}

	public void setProductionRuleType(final BusinessRuleType businessRuleType) {
		this.businessRuleType = businessRuleType;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(final int priority) {
		this.priority = priority;
	}

	public Action getAction() {
		return action;
	}

	public void setAction(final Action action) {
		this.action = action;
	}

	public void accept(@NotNull final ProductionRuleVisitor visitor) {
		visitor.visitProductionRule(this);

	}

	public String getName() {
		return getAction().getName();
	}
}